import request from '@/utils/request'

// 登录函数
/**
 * @description: 登录函数
 * @param {*} data { mobile,password}
 * @return {*} promise
 */
export function loginAPI({ username, password }) {

  return request({
    url: '/park/login',
    method: 'POST',
    data: {
      username, password
    }
  })
}
export function basicnum() {
  return request({
    url: '/home/workbench/info',
    method: 'get',

  })
}
export function yuekalb(params) {

  return request({
    url: '/parking/card/list',

    params
  })
}
export function yuekaadd(form) {
  return request({
    url: "/parking/card",
    method: "POST",
    data: form
  })
}
export function yuekadetail(id) {
  return request({
    url: `/parking/card/detail/${id}`
  })
}
export function yuekaedit(form) {
  return request({
    url: "/parking/card/edit",
    method: "PUT",
    data: form
  })
}
export function yuekadetail1(id) {
  return request({
    url: `parking/card/${id}`
  })
}
export function yuekaxufei(form) {
  return request({
    url: `/parking/card/recharge`,
    method: "POST",
    data: form

  })
}
export function yuekashanchu(ids) {
  return request({
    url: `/parking/card/${ids}`,
    method: "Delete"
  })
}
export function yuekatip() {

  return request({
    url: '/parking/card/proportion',

  })
}
export function qylb(params) {

  return request({
    url: '/park/enterprise',

    params
  })
}
export function industylb() {
  return request({
    url: "/park/industry",
    method: "Get"
  })
}
export function uploadAPI(data) {
  return request({
    url: '/upload',
    method: 'POST',
    data
  })
}
export function qyadd(form) {
  return request({
    url: "/park/enterprise",
    method: "POST",
    data: form
  })
}
export function qydetail1(id) {
  return request({
    url: `/park/enterprise/${id}`
  })
}
export function qyedit(form) {
  return request({
    url: "/park/enterprise",
    method: "PUT",
    data: form
  })
}
export function qyshanchu(ids) {
  return request({
    url: `/park/enterprise/${ids}`,
    method: "Delete"
  })
}
export function qylylist() {
  return request({
    url: "/park/rent/building",
    method: "GET"
  })
}
export function addht(form) {
  return request({
    url: "/park/enterprise/rent",
    method: "POST",
    data: form
  })
}
export function rentlist(id) {
  return request({
    url: `/park/enterprise/rent/${id}`,
    method: "GET"
  })
}
export function renttuizu(id) {
  return request({
    url: `/park/enterprise/rent/${id}`,
    method: "PUT"
  })

}
export function rentshanchu(id) {
  return request({
    url: `/park/enterprise/rent/${id}`,
    method: "DELETE"
  })

}
export function jfgzgl(params) {

  return request({
    url: '/parking/rule/list',

    params
  })
}
export function addjfgzgl(data) {

  return request({
    url: '/parking/rule',
    method: "POST",
    data: data
  })
}
export function jfgzglxq(id) {
  return request({
    url: `/parking/rule/${id}`,
    method: "GET"
  })

}
export function editjfgzgl(data) {

  return request({
    url: '/parking/rule',
    method: "PUT",
    data: data
  })
}
export function jfgzglshanchu(id) {
  return request({
    url: `/parking/rule/${id}`,
    method: "DELETE"
  })

}
export function rolelb() {
  return request({
    url: `/park/sys/role`,
    method: "GET"
  })

}
export function rolelist() {
  return request({
    url: "/park/sys/permision/all/tree"
  })
}
export function roleid(roleId) {
  return request({
    url: `/park/sys/role/${roleId}`
  })
}
export function roleuser(roleId, params) {
  return request({
    url: `/park/sys/roleUser/${roleId}`,
    params
  })
}
export function addroleuser(form) {
  return request({
    url: `/park/sys/role`,
    method: "post",
    data: form
  })
}
export function editroleuser(form) {
  return request({
    url: `/park/sys/role`,
    method: "put",
    data: form
  })
}

export function roledetail(roleId) {
  return request({
    url: `/park/sys/role/${roleId}`,

  })
}
export function roledelete(id) {
  return request({
    url: `/park/sys/role/${id}`,
    method: "DELETE"
  })

}

export function getprofile() {
  return request({
    url: "/park/user/profile"
  })
}
export function getlouyu(params) {
  return request({
    url: "/park/building",
    params
  })
}
export function addbuild(form) {
  return request({
    url: `/park/building`,
    method: "post",
    data: form
  })
}
export function editbuild(form) {
  return request({
    url: `/park/building`,
    method: "put",
    data: form
  })
}

export function builddelete(id) {
  return request({
    url: `/park/building/${id}`,
    method: "DELETE"
  })

}

export function getyuangong(params) {
  return request({
    url: "/park/sys/user",
    params
  })
}
export function addyuangong(form) {
  return request({
    url: `/park/sys/user`,
    method: "post",
    data: form
  })
}
export function edityuangong(form) {
  return request({
    url: `/park/sys/user`,
    method: "put",
    data: form
  })
}

export function rolelistxl() {
  return request({
    url: "/park/sys/role",
    method: "GET"
  })
}

export function userdelete(id) {
  return request({
    url: `/park/sys/user/${id}`,
    method: "DELETE"
  })

}
export function userchongzhi(id) {
  return request({
    url: `/park/sys/user/resetPwd`,
    method: "PUT",
    data:{
      id:id
    }
  })

}
export function getytg(params) {
  return request({
    url: "/pole/info/list",
    params
  })
}

export function addytg(form) {
  return request({
    url: `/pole/info`,
    method: "post",
    data: form
  })
}

export function editytg(form) {
  return request({
    url: `/pole/info`,
    method: "put",
    data: form
  })
}
export function deleteytg(ids) {
  return request({
    url: `/pole/info/${ids}`,
    method: "delete"
  })
}

